#ifndef F_CASgiIrqDriverC_h
#define F_CASgiIrqDriverC_h

// ***********************************************************************

// class EDROOMTopContext

// ***********************************************************************



class EDROOMTopContext {

protected:

enum EDROOMCASgiIrqDriverSignal { EDROOMSignalTimeout, EDROOMSignalDestroy, SReceivedMessage, SNotReceivedMessage, SToWaitFromGround, EDROOMIRQsignal };


	friend class CASgiIrqDriver;

	CASgiIrqDriver &EDROOMcomponent;

	CEDROOMMessage * &Msg;

	CEDROOMMessage * &MsgBack;

	//Ports

	CEDROOMInterface & SgiDriver;
	CEDROOMIRQInterface & SGIIrq;
	CEDROOMTimingInterface & Timer;

	enum edroomStateId{I, SubEstado1};

	enum IdTrans{Transicion0,  EDROOMMEMORIA };

	//Constantes



	//Variables

	int &VPrueba;


	//Pool



	// CONSTRUCTORES

	EDROOMTopContext (CASgiIrqDriver &act, int & EDROOMpVarVPrueba );

	EDROOMTopContext ( EDROOMTopContext &contex );

public:

	bool EDROOMSearchContextTrans(TEDROOMTransId &edroomCurrentTrans);

	void EDROOMNuevoMens () { EDROOMcomponent.EDROOMNewMsg(); }

};

// ***********************************************************************

// class EDROOMTopState

// ***********************************************************************



class EDROOMTopState : public EDROOMTopContext {

protected:



	EDROOMTopContext::edroomStateId edroomCurrentState;

	EDROOMTopContext::edroomStateId edroomNextState;

	//Variables

	int VPrueba;


	//Pools



public:

	// CONSTRUCTOR

	EDROOMTopState (CASgiIrqDriver &act );


	// EDROOMBehaviour**********************************************

	void EDROOMBehaviour();

	// Inicio**********************************************

	void EDROOMInicio();

	// ***********************************************************************

	// SubEstado Inicial 

	// ***********************************************************************



	TEDROOMTransId EDROOMIllegada();

	// ***********************************************************************

	// SubEstado Hoja SubEstado1

	// ***********************************************************************



	TEDROOMTransId EDROOMSubEstado1llegada();

};


#endif
